package v1

import (
	"github.com/mozillazg/go-pinyin"
	"strings"
)

func getTextToPinyin(data string) []string {
	str := strings.Split(data, "\n")
	//fmt.Println(str)
	resStr := []string{}
	for _, item := range str {
		a := pinyin.NewArgs()
		pinyinStr := pinyin.Pinyin(item, a)
		strX := ""
		//循环拼接数组为字符串
		for _, i := range pinyinStr {
			for _, x := range i {
				strX = strX + x
			}
		}
		resStr = append(resStr, strX)
	}
	return resStr
}
